<#assign className = table.className>
<#assign classNameLower = className?uncap_first>
package ${basepackage}.pojo.${table.classNameFirstLower};


import me.luger.core.dao.nutz.entity.BaseEntity;
import org.nutz.dao.entity.annotation.*;
import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;
import java.util.Date;

@Table("${table.sqlName}")
public class ${className} extends BaseEntity implements Serializable{
private static final long serialVersionUID=1L;


    <#list table.columns as column>
    /**
     * ${column.remarks}
     */
    <#if column.isPk()&&column.sqlTypeName=='INT'>
    @Id
    <#elseif column.isPk()&&column.sqlTypeName=='VARCHAR'>
    @Name
    </#if>
    @Column("${column.sqlName}")
    @Comment("${column.remarks}")
    <#if column.sqlTypeName=='INT'>
    @ColDefine(type = ColType.INT, width = ${column.size})
    <#elseif column.sqlTypeName=='TINYINT'>
    @ColDefine(type = ColType.INT, width = ${column.size})
    <#elseif column.sqlTypeName=='FLOAT'>
    @ColDefine(type = ColType.FLOAT, width = ${column.size})
    <#elseif column.sqlTypeName=='CHAR'>
    @ColDefine(type = ColType.CHAR, width = ${column.size})
    <#elseif column.sqlTypeName=='VARCHAR'>
    @ColDefine(type = ColType.VARCHAR, width = ${column.size})
    <#elseif column.sqlTypeName=='TEXT'>
    @ColDefine(type = ColType.TEXT, width = ${column.size})
    <#elseif column.sqlTypeName=='DATETIME'>
    @ColDefine(type = ColType.DATETIME, width = ${column.size})
    @JSONField (format="yyyy-MM-dd HH:mm:ss")
    <#elseif column.sqlTypeName=='TIMESTAMP'>
    @ColDefine(type = ColType.DATETIME, width = ${column.size})
    @JSONField (format="yyyy-MM-dd HH:mm:ss")
    <#elseif column.sqlTypeName=='DATE'>
    @ColDefine(type = ColType.DATE, width = ${column.size})
    @JSONField (format="yyyy-MM-dd HH:mm:ss")
    <#elseif column.sqlTypeName=='TIME'>
    @ColDefine(type = ColType.TIME, width = ${column.size})
    @JSONField (format="yyyy-MM-dd HH:mm:ss")
    <#elseif column.sqlTypeName=='BLOB'>
    @ColDefine(type = ColType.BINARY, width = ${column.size})
    <#else>
    @ColDefine(customType = "${column.sqlTypeName}", width = ${column.size})
    </#if>
    private ${column.simpleJavaType} ${column.columnNameLower};
    </#list>

    <@generateJavaColumns/>

    <#macro generateJavaColumns>
    <#list table.columns as column>
    public void set${column.columnName}(${column.simpleJavaType} ${column.columnNameLower}){
        this.${column.columnNameLower}=${column.columnNameLower};
    }
    public ${column.simpleJavaType} get${column.columnName}(){
        return this.${column.columnNameLower};
    }

    </#list>
    </#macro>
}